The present disclosure relates to a camera such as surveillance camera, particularly relates to a method for calculating auto-focusing evaluation value with respect to a camera in a scene having a dynamic light source.
Auto-focusing is important for a camera to capture clear image. The performance of auto-focusing depends on accuracy and effectiveness of focusing evaluation function. A good focusing evaluation function is crucial to achieve auto-focusing in an integrated camera and may have characteristics such as good unbiasedness, single peak and anti-noise. Image blurring is usually due to loss of high frequency component, and thus a focusing evaluation function may be designed in such a way that a focused image contains more information and details than an out-of-focus image.
A focusing evaluation curve (may also be referred as “image definition evaluation curve”) under a night scene having a dynamic light source is illustrated in FIG. 1. The horizontal coordinate represents a relative value of a focus position, and the vertical coordinate represents a focusing evaluation value (may also be referred as “image definition evaluation value”) calculated according to a focusing evaluation function. There are two peaks on the curve, and position 1 corresponding to the peak of highest image definition evaluation value may be finally selected as focus position. However, an image actually obtained at position 2 may have a higher definition than an image actually obtained at position 1. It may indicate that the focusing evaluation function loses effectiveness. For example, if a dynamic light source in the scene switches from on to off during the auto-focusing, the brightness in some region corresponding to position 2 may be lower than the brightness in some region corresponding to position 1, it may cause the focusing evaluation value corresponding to position 2 to be lower than the focusing evaluation value corresponding to position 1, and thus have negative effect on the accuracy and effectiveness of the auto-focusing evaluation function.